//
// Created by shen on 2024/6/22.
//

#ifndef AUDIOCAMERA_MYGLRENDERCONTEXT_H
#define AUDIOCAMERA_MYGLRENDERCONTEXT_H

#include <GLES3/gl3.h>
#include "GLBase.h"

class MyGLRenderContext {
    MyGLRenderContext();

    ~MyGLRenderContext();
public:
    void SetImageData(int format, int width, int height, uint8_t *pData);

    void OnSurfaceCreated();


    void OnDrawFrame();

    void OnSurfaceChanged(int width, int height);
    static void DestroyInstance();
    static MyGLRenderContext* GetInstance();

private:
    static MyGLRenderContext *m_pContext;


    GLBase *m_pBeforeSample;
    GLBase *m_pCurSample;

    int m_ScreenW;
    int m_ScreenH;
};


#endif //AUDIOCAMERA_MYGLRENDERCONTEXT_H
